﻿using System;
using System.Collections.Generic;
using System.Text;

namespace RaisingStudio.Data.Entities.MSPetShop4
{
    partial class Supplier : RaisingStudio.Data.Common.IDataObjectProxy
    {
        #region IDataObjectProxy Members

        public Type GetPropertyType(string name)
        {
            switch (name)
            {                
                case "SuppId":
                   {
                       return typeof(int);
                   }
                case "Name":
                   {
                       return typeof(string);
                   }
                case "Status":
                   {
                       return typeof(string);
                   }
                case "Addr1":
                   {
                       return typeof(string);
                   }
                case "Addr2":
                   {
                       return typeof(string);
                   }
                case "City":
                   {
                       return typeof(string);
                   }
                case "State":
                   {
                       return typeof(string);
                   }
                case "Zip":
                   {
                       return typeof(string);
                   }
                case "Phone":
                   {
                       return typeof(string);
                   }
                default:
                    {
                        throw new System.ArgumentOutOfRangeException(name);
                    }
            }
        }

        #endregion

        #region IObjectAccessor Members

        public object GetValue(object instance, string name)
        {
            Supplier _instance = instance as Supplier;
            switch (name)
            {                
                case "SuppId":
                   {
                       return _instance.SuppId;
                   }
                case "Name":
                   {
                       return _instance.Name;
                   }
                case "Status":
                   {
                       return _instance.Status;
                   }
                case "Addr1":
                   {
                       return _instance.Addr1;
                   }
                case "Addr2":
                   {
                       return _instance.Addr2;
                   }
                case "City":
                   {
                       return _instance.City;
                   }
                case "State":
                   {
                       return _instance.State;
                   }
                case "Zip":
                   {
                       return _instance.Zip;
                   }
                case "Phone":
                   {
                       return _instance.Phone;
                   }
                default:
                    {
                        throw new System.ArgumentOutOfRangeException(name);
                    }
            }
        }

        public void SetValue(object instance, string name, object value)
        {
            Supplier _instance = instance as Supplier;
            switch (name)
            {                
                case "SuppId":
                    {
                        _instance.SuppId = (int)value;
                        return;
                    }
                case "Name":
                    {
                        _instance.Name = (string)value;
                        return;
                    }
                case "Status":
                    {
                        _instance.Status = (string)value;
                        return;
                    }
                case "Addr1":
                    {
                        _instance.Addr1 = (string)value;
                        return;
                    }
                case "Addr2":
                    {
                        _instance.Addr2 = (string)value;
                        return;
                    }
                case "City":
                    {
                        _instance.City = (string)value;
                        return;
                    }
                case "State":
                    {
                        _instance.State = (string)value;
                        return;
                    }
                case "Zip":
                    {
                        _instance.Zip = (string)value;
                        return;
                    }
                case "Phone":
                    {
                        _instance.Phone = (string)value;
                        return;
                    }
                default:
                    {
                        throw new System.ArgumentOutOfRangeException(name);
                    }
            }
        }

        #endregion

        #region IObjectCreater Members

        public object CreateObject()
        {
            return new Supplier();
        }

        public System.Collections.IList CreateObjectList()
        {
            return new System.Collections.Generic.List<Supplier>();
        }

        #endregion
    }
}
